package com.b.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * 直播表
 */
@Document(indexName = "live")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Live {
    /**
     * 自增主键
     */
    @Id
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer id;

    /**
     * up主id
     */
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer userId;

    /**
     * 标题
     */
    private String title;

    /**
     * 封面图
     */
    private String coverImage;

    /**
     * 推流地址
     */
    private String pushAddress;

    /**
     * 直播流的应用名
     */
    private String streamApplicationName;

    /**
     * 流的密钥名
     */
    private String streamKey;

    /**
     * 拉流地址
     */
    private String pullAddress;

    /**
     * 开播时间
     */
    private Date liveStartTime;

    /**
     * 直播状态
     */
    @Field(type = FieldType.Text, index = true , store = true)
    private String liveStatus;

    /**
     * 分区id
     */
    private Integer categoryId;

    /**
     * 结束时间
     */
    private Date liveEndTime;

    /**
     * 直播间观看量
     */
    private Integer playCount;

    /**
     * 直播间人气(正在观看人数)
     */
    private Integer lookingCount;

    private User author;
}